<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
		<title>资料设置</title>
		<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/vant@2.5/lib/index.css">
		<link rel="stylesheet" href="/statics/wxdemo/css/global.css">
		<link rel="stylesheet" href="/statics/wxdemo/css/frienddetail.css">
		<link rel="stylesheet" href="/statics/wxdemo/css/friendSet.css">
		<script src="/statics/wxdemo/js/flexble.js"></script>
		<script src="https://cdn.jsdelivr.net/npm/vue@2.6.11"></script>
		<script src="https://cdn.jsdelivr.net/npm/vant@2.5/lib/vant.min.js"></script>
		<script type="text/javascript" src="/statics/wxdemo/sdk/webimSDK3.1.2.js"></script>
		<script type="text/javascript" src="/statics/wxdemo/js/WebIMConfig.js"></script>
		<script type="text/javascript" src="/statics/wxdemo/js/webconn.js"></script>
		<script type="text/javascript" src="/statics/wxdemo/js/localstorage.js"></script>
		<script type="text/javascript" src="/statics/wxdemo/utils/login.js"></script>
	</head>
	<body>
		<div id="bigbox" class="friendDetailBox">
			<div class="fixedtop">
				<div class="getBack">
					<van-button class="arrowbox" type="default" @click="back">
						<img src="/statics/wxdemo/img/back.png">
					</van-button>
				</div>
			</div>
			<div class="detailbox">
				<img class="avatar" src="/statics/wxdemo/img/avatar.jpg" >
				<p class="name">{{detail.name}}</p>
			</div>
			<van-button class="sendmsg delbox" type="default" @click="delfriend">
				<div class="sendmsg_leftbox">
					<span>删除</span>
				</div>
			</van-button>
		</div>
	</body>
</html>
<script type="text/javascript">
var webvue = new Vue({
	el: '#bigbox',
	data() {
		return {
			detail:''
		}
	},
	mounted(){
		if(getStorage('pagedata')){
			this.detail = getStorage('pagedata');
			console.log(this.detail)
			saveStorage('pagedata','')
		}
		isfirst = 10;
		relogin();
		// setTimeout(()=>{
		// 	this.bigboxshow = true;
		// },500)
	},
	methods:{
		back(){
			window.location.href = '/Welcome/addressbook';
		},
		gourl(url){
			window.location.href = url;
		},
		//删除好友
		delfriend(){
			var that = this;
			vant.Dialog.confirm({
				title: '提示',
				message: '确定要删除' + that.detail.name +'吗？',
			})
			.then(() => {
				// on confirm
				var option = {
					to: this.detail.sendID
				}
				conn.removeRoster(option);
				vant.Toast.success('操作成功');
				setTimeout(()=>{
					window.location.href = '/Welcome/addressbook';
				},1000)
			})
			.catch(() => {
				// on cancel
			});
		},
	}
})
</script>